﻿@using EC.Entity.Response.BalanceLog
@using EC.Entity.Enum

@model EC.Entity.PagedList<BalanceLogQueryResponse>
<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l wd75">编号</th>
                        <th class="t_l wd100">商户</th>
                        <th class="t_l wd100">来源</th>
                        <th class="t_r wd100">金额</th>
                        <th class="t_r wd100">之前余额</th>
                        <th class="t_r wd100">之后余额</th>
                        <th class="t_r wd100">操作人</th>
                        <th class="t_l">备注</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (IEnumerable<BalanceLogQueryResponse>)Model.TData)
                        {
                    <tr>
                        <td class="t_l wd75">@(item.Id)</td>
                        <td class="t_l wd100">@(item.MerchantName)</td>
                        <td class="t_l wd100">
                            @switch (item.Source)
                            {
                                case (sbyte)BalanceLogSource.存款余额:
                                    <span>存款余额</span>
                                    break;
                                case (sbyte)BalanceLogSource.余额冻结:
                                    <span>余额冻结</span>
                                    break;
                                case (sbyte)BalanceLogSource.付款余额:
                                    <span>付款余额</span>
                                    break;
                                case (sbyte)BalanceLogSource.余额解冻:
                                    <span>余额解冻</span>
                                    break;
                                case (sbyte)BalanceLogSource.预付:
                                    <span>预付</span>
                                    break;
                                case (sbyte)BalanceLogSource.充值:
                                    <span>充值</span>
                                    break;
                                case (sbyte)BalanceLogSource.充值带手续费:
                                    <span>充值(带手续费)</span>
                                    break;
                                case (sbyte)BalanceLogSource.扣除代付余额:
                                    <span>扣除代付余额</span>
                                    break;
                                case (sbyte)BalanceLogSource.收款撤销:
                                    <span>收款撤销</span>
                                    break;
                                case (sbyte)BalanceLogSource.代付撤销:
                                    <span>代付撤销</span>
                                    break;
                                case (sbyte)BalanceLogSource.代付失败:
                                    <span>代付失败</span>
                                    break;
                                case (sbyte)BalanceLogSource.结算:
                                    <span>结算</span>
                                    break;
                                case (sbyte)BalanceLogSource.扣减余额:
                                    <span>扣减余额</span>
                                    break;
                                case (sbyte)BalanceLogSource.恢复成功:
                                    <span>恢复成功</span>
                                    break;
                                default:
                                    <span></span>
                                    break;
                            }
                        </td>
                        <td class="t_r wd100">
                            @switch (item.Type)
                            {
                                case (sbyte)BalanceLogType.加:
                                    <span class="bold">+</span>
                                    break;
                                case (sbyte)BalanceLogType.减:
                                    <span class="bold">-</span>
                                    break;
                                default:
                                    <span></span>
                                    break;
                            }
                            @(item.Amount)
                        </td>
                        <td class="t_r wd100">@(item.BeforeBalance)</td>
                        <td class="t_r wd100">@(item.AfterBalance)</td>
                        <td class="t_r wd100">
                            @{ 
                                if (item.CreatedBy != 0)
                                {
                                    <span>@(item.CreatedByName)</span>
                                }
                                else
                                {
                                    <span>系统</span>
                                }
                            }
                        </td>
                        <td class="t_l">@(item.Remark)</td>
                    </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="6" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />